
package educar.abmMateria;


import java.awt.event.ActionListener;
import javax.swing.JButton;

/**
 *
 * @author Marcela Bessone.
 */

public class AgregarMateriaView extends javax.swing.JDialog {

// <editor-fold defaultstate="collapsed" desc="Constructor">
    public AgregarMateriaView() {
        initComponents();
    }
// </editor-fold>

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jlTitulo = new javax.swing.JLabel();
        jlCodmateria = new javax.swing.JLabel();
        jtfCodmateria = new javax.swing.JTextField();
        jtfNombre = new javax.swing.JTextField();
        jtfDNIDocente = new javax.swing.JTextField();
        jlnombre = new javax.swing.JLabel();
        jlDNIdocente = new javax.swing.JLabel();
        jbAceptar = new javax.swing.JButton();
        jbCancelar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jlTitulo.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jlTitulo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jlTitulo.setText("Agregar Nueva Materia");

        jlCodmateria.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jlCodmateria.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jlCodmateria.setText("Codigo Materia");

        jlnombre.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jlnombre.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jlnombre.setText("Nombre Materia");

        jlDNIdocente.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jlDNIdocente.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jlDNIdocente.setText("DNI Docente");

        jbAceptar.setText("Aceptar");

        jbCancelar.setText("Cancelar");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jlTitulo, javax.swing.GroupLayout.DEFAULT_SIZE, 312, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jlDNIdocente, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jlnombre, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jlCodmateria, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jtfNombre)
                            .addComponent(jtfCodmateria, javax.swing.GroupLayout.DEFAULT_SIZE, 197, Short.MAX_VALUE)
                            .addComponent(jtfDNIDocente)))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jbAceptar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 166, Short.MAX_VALUE)
                        .addComponent(jbCancelar)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jlTitulo, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jlCodmateria, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtfCodmateria, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtfNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jlnombre, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtfDNIDocente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jlDNIdocente, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 84, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jbAceptar)
                    .addComponent(jbCancelar))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

// <editor-fold defaultstate="collapsed" desc="Declaracion de variables">
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jbAceptar;
    private javax.swing.JButton jbCancelar;
    private javax.swing.JLabel jlCodmateria;
    private javax.swing.JLabel jlDNIdocente;
    private javax.swing.JLabel jlTitulo;
    private javax.swing.JLabel jlnombre;
    private javax.swing.JTextField jtfCodmateria;
    private javax.swing.JTextField jtfDNIDocente;
    private javax.swing.JTextField jtfNombre;
    // End of variables declaration//GEN-END:variables
// </editor-fold>

    public JButton getJbAceptar() {
        return jbAceptar;
    }

    public JButton getJbCancelar() {
        return jbCancelar;
    }

    public String getNombre() {
        return jtfNombre.getText();
    }

    public String getDNIDocente() {
        return jtfDNIDocente.getText();
    }

    public String getCodmateria() {
        return jtfCodmateria.getText();
    }
    
     public void setNombre(String nombre) {
        this.jtfNombre.setText(nombre);
    }

    public void setCodmateria(String codigo) {
        this.jtfCodmateria.setText(codigo);
    }

    public void setDNIDocente(String dni) {
        this.jtfDNIDocente.setText(dni);
    }
    
    public void setActionListener(ActionListener listener) {
        jbAceptar.addActionListener(listener);
        jbCancelar.addActionListener(listener);
    }
    
    public void setWindowListener(AgregarMateriaController listener){
        this.addWindowListener(listener);
    }

    void setTitulo(String Titulo) {
        this.jlTitulo.setText(Titulo);
    }
    
}  //fin clase AgregarMateriaView.